package com.topInterview;

import java.util.Arrays;

/**
 * @Author: huangzhigao
 * @Date: 2022/2/20 13:17
 */
public class leecode268_missNum {
    public static  int missingNumber(int[] nums) {
        Arrays.sort(nums);
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (index != nums[i]) {
                return index;
            }
            index++;
        }
        return index ;
    }


    public static void main(String[] args) {
        int[] s = {0,1};
        missingNumber(s);
    }
}
